package com.patterns.demo.Iterator.collection;


import com.patterns.demo.Iterator.iterator.Iterator;
import com.patterns.demo.Iterator.iterator.MyIterator;

/**
 * Author: SamGroves
 * <p>
 * Description:
 * <p>
 * Date: 2017/12/19
 */
public class MyCollection implements Collection {

    private String string[] = {"a", "b", "c", "d", "e"};

    @Override
    public Iterator iterator() {
        return new MyIterator(this);
    }

    @Override
    public Object get(int i) {
        return string[i];
    }

    @Override
    public int size() {
        return string.length;
    }
}
